<template>
  <div class="item">
    <div class="img">
      <img alt="缩略图" :src="src"/>
    </div>
    <div class="demo-keyword">
      <label class="tt-label">关键字：</label>
      <p>{{demo.label}}</p>
      <div class="demo-describe">
        {{demo.content}}
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "",
    props: {
      item: {
        type: Object,
        default: {},
        required: true
      }
    },
    data() {
      return {
        demo: null,
        src: ''
      }
    },
    created() {
      this.demo = this.item
      this.src = this.demo instanceof Object ? require('@/assets/' + this.demo.path) : require('@/assets/user/photo1.png')
    }
  }
</script>

<style scoped lang="scss">
  .item{
    width: 100%;
    height: 100%;
    overflow: hidden;
    .img{
      width: 100%;
      max-height: 180px;
      overflow: hidden;
      img{
        width:100%;
        transition: all 0.5s;
        -moz-transition: all 0.5s;
        -webkit-transition: all 0.5s;
      }
      &:hover{
        img{
          -webkit-transition: .5s transform;
          transition: .5s transform;
          -webkit-transform: scale(1.2);
          transform: scale(1.2);
          -webkit-filter: grayscale(100%);
        }
      }
    }
    .demo-keyword{
      font-weight :700;
      padding:3px 0;
      .tt-label{
        color: #000;
        font-size:18px;
      }
      p{
        display: inline-block;
        font-size :16px;
      }
    }
    .demo-describe{
      height: 44px;
      padding: 3px 0;
      color: #565656;
      font-size:14px;
      font-weight :600;
      line-height :20px;
      text-overflow :ellipsis;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
    }
  }

</style>
